package com.example.practical_training_projects.service;

import com.example.practical_training_projects.entity.test2;
import com.example.practical_training_projects.entity.user;
import com.example.practical_training_projects.mapper.test2Mapper;
import com.example.practical_training_projects.mapper.testMapper;
import com.example.practical_training_projects.vo.votest2class;
import com.example.practical_training_projects.vo.votestclass;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class test2Servicelmpl implements test2Service {
    @Autowired
    private test2Mapper mapper;
    @Override
    public List<test2> getAlltest2() {
        return mapper.getAlltest2();
    }

    @Override
    public Integer deleteTest2(Integer t2_uid) {
        return mapper.deleteTest2(t2_uid);
    }

    @Override
    public Integer insertTest2(test2 t2_uid) {
        return mapper.insertTest2(t2_uid);
    }

    @Override
    public test2 findTest2uid(Integer t2_uid) {
        return mapper.findTest2uid(t2_uid);
    }

    @Override
    public Integer updateTest2(test2 test2) {
        return mapper.updateTest2(test2);
    }

    @Override
    public List<test2> getContest2(String t2_context) {
        return mapper.getContest2(t2_context);
    }

    @Override
    public List<votest2class> findAlltest2Andclass() {
        return mapper.findAlltest2Andclass();
    }

    @Override
    public List<votest2class> findtest2Bycontext(String t2_context) {
        return mapper.findtest2Bycontext(t2_context);
    }

    @Override
    public List<votest2class> findtest2BycontextAndclassuid(Integer ts_uid, String t2_context) {
        return mapper.findtest2BycontextAndclassuid(ts_uid,t2_context);
    }

    @Override
    public PageInfo<votest2class> findtestpage(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<votest2class> lists=mapper.findAlltest2Andclass();
        PageInfo<votest2class> pageInfo=new PageInfo<>(lists);
        return pageInfo;
    }
}
